# Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# NOTE: This file is auto generated by the elixir code generator program.
# Do not edit this file manually.

defmodule GoogleApi.Integrations.V1alpha.Model.EnterpriseCrmEventbusProtoCloudKmsConfig do
  @moduledoc """


  ## Attributes

  *   `gcpProjectId` (*type:* `String.t`, *default:* `nil`) - Optional. The id of GCP project where the KMS key is stored. If not provided, assume the key is stored in the same GCP project defined in Client (tag 14).
  *   `keyName` (*type:* `String.t`, *default:* `nil`) - A Cloud KMS key is a named object containing one or more key versions, along with metadata for the key. A key exists on exactly one key ring tied to a specific location.
  *   `keyRingName` (*type:* `String.t`, *default:* `nil`) - A key ring organizes keys in a specific Google Cloud location and allows you to manage access control on groups of keys. A key ring's name does not need to be unique across a Google Cloud project, but must be unique within a given location.
  *   `keyVersionName` (*type:* `String.t`, *default:* `nil`) - Optional. Each version of a key contains key material used for encryption or signing. A key's version is represented by an integer, starting at 1. To decrypt data or verify a signature, you must use the same key version that was used to encrypt or sign the data.
  *   `locationName` (*type:* `String.t`, *default:* `nil`) - Location name of the key ring, e.g. "us-west1".
  *   `serviceAccount` (*type:* `String.t`, *default:* `nil`) - Optional. The service account used for authentication of this KMS key. If this is not provided, the service account in Client.clientSource will be used.
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :gcpProjectId => String.t() | nil,
          :keyName => String.t() | nil,
          :keyRingName => String.t() | nil,
          :keyVersionName => String.t() | nil,
          :locationName => String.t() | nil,
          :serviceAccount => String.t() | nil
        }

  field(:gcpProjectId)
  field(:keyName)
  field(:keyRingName)
  field(:keyVersionName)
  field(:locationName)
  field(:serviceAccount)
end

defimpl Poison.Decoder,
  for: GoogleApi.Integrations.V1alpha.Model.EnterpriseCrmEventbusProtoCloudKmsConfig do
  def decode(value, options) do
    GoogleApi.Integrations.V1alpha.Model.EnterpriseCrmEventbusProtoCloudKmsConfig.decode(
      value,
      options
    )
  end
end

defimpl Poison.Encoder,
  for: GoogleApi.Integrations.V1alpha.Model.EnterpriseCrmEventbusProtoCloudKmsConfig do
  def encode(value, options) do
    GoogleApi.Gax.ModelBase.encode(value, options)
  end
end
